/*
 * 컴파일을 위해 올려 놓은 소스 입니다.
 * 서버에 반영하지 마시고 다른국가에 적용할 경우 서버에 있는 class 를 카피해서 사용하십시오.
 * 
 */
/*
 * Created on 2004. 9. 29.
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package com.pushmsg.OmaOtaConf.OmaOtaObject;

/**
 * @author dgchun
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class BOOTSTRAP 
{
	private String name=null;
	
	public BOOTSTRAP(String name)
	{
		this.name = name;
	}
	
	public void setName(String name)
	{
		this.name = name;
	}
	
	public int getData(byte[] buffer, int index)
	{
		if(name==null)
			return -1;
		int startPos=index;
		
		buffer[index++] = (byte)0xC6;
		buffer[index++] = (byte)0x56;
		buffer[index++] = (byte)0x01;
		
		buffer[index++] = (byte)0x87;
		buffer[index++] = (byte)0x07;
		buffer[index++] = (byte)0x06;
		buffer[index++] = (byte)0x03;		
		System.arraycopy(name.getBytes(), 0, buffer, index, name.length());
		index += name.length();
		buffer[index++] = (byte)0x00;
		buffer[index++] = (byte)0x01;
		buffer[index++] = (byte)0x01;
		
		return index - startPos;
	}
}
